package com.ruoyi.shopping.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shopping.mapper.MallIntegralRecordMapper;
import com.ruoyi.shopping.domain.MallIntegralRecord;
import com.ruoyi.shopping.service.IMallIntegralRecordService;

/**
 * 用户积分记录Service业务层处理
 *
 * @author scx
 * @date 2022-06-09
 */
@Service
public class MallIntegralRecordServiceImpl implements IMallIntegralRecordService
{
    @Autowired
    private MallIntegralRecordMapper mallIntegralRecordMapper;

    /**
     * 查询用户积分记录
     *
     * @param id 用户积分记录主键
     * @return 用户积分记录
     */
    @Override
    public MallIntegralRecord selectMallIntegralRecordById(Long id)
    {
        return mallIntegralRecordMapper.selectMallIntegralRecordById(id);
    }

    /**
     * 查询用户积分记录列表
     *
     * @param mallIntegralRecord 用户积分记录
     * @return 用户积分记录
     */
    @Override
    public List<MallIntegralRecord> selectMallIntegralRecordList(MallIntegralRecord mallIntegralRecord)
    {
        return mallIntegralRecordMapper.selectMallIntegralRecordList(mallIntegralRecord);
    }

    /**
     * 新增用户积分记录
     *
     * @param mallIntegralRecord 用户积分记录
     * @return 结果
     */
    @Override
    public int insertMallIntegralRecord(MallIntegralRecord mallIntegralRecord)
    {
        mallIntegralRecord.setCreateTime(DateUtils.getNowDate());
        return mallIntegralRecordMapper.insertMallIntegralRecord(mallIntegralRecord);
    }

    /**
     * 修改用户积分记录
     *
     * @param mallIntegralRecord 用户积分记录
     * @return 结果
     */
    @Override
    public int updateMallIntegralRecord(MallIntegralRecord mallIntegralRecord)
    {
        mallIntegralRecord.setUpdateTime(DateUtils.getNowDate());
        return mallIntegralRecordMapper.updateMallIntegralRecord(mallIntegralRecord);
    }

    /**
     * 批量删除用户积分记录
     *
     * @param ids 需要删除的用户积分记录主键
     * @return 结果
     */
    @Override
    public int deleteMallIntegralRecordByIds(Long[] ids)
    {
        return mallIntegralRecordMapper.deleteMallIntegralRecordByIds(ids);
    }


    /**
     * 批量逻辑删除用户积分记录
     *
     * @param ids 需要删除的用户积分记录主键
     * @return 结果
     */
    @Override
    public int logicDeleteMallIntegralRecord(Long[] ids,String delType,Long delUser)
    {
        return mallIntegralRecordMapper.logicDeleteMallIntegralRecord(ids,delType,delUser);
    }

    /**
     * 删除用户积分记录信息
     *
     * @param id 用户积分记录主键
     * @return 结果
     */
    @Override
    public int deleteMallIntegralRecordById(Long id)
    {
        return mallIntegralRecordMapper.deleteMallIntegralRecordById(id);
    }
}
